import {RouteRecordRaw } from 'vue-router'
import {staticRoutes,anyRoutes,ruleRouter} from "../router/routes"

//判断权限路由 是否 为管理员 或 用户
export function isRuleRouter(rule:string|number=1): Array<RouteRecordRaw>{
    if(rule=="管理员"||rule==1){
        return [...staticRoutes,...anyRoutes,...ruleRouter]
    }
    return [...staticRoutes,...anyRoutes]
}
//基本路由
export function baseRouter(rule:string|number=1): Array<RouteRecordRaw>{
    return [...staticRoutes,...anyRoutes]
}

// function filterChildren(ruleRouter:Array<RouteRecordRaw>){
//    let tempArray:Array<RouteRecordRaw>=[]
//     ruleRouter.filter(el=>{
//         if(el.children)tempArray.push(el.children[0])
//     })
//     return tempArray
// }